package com.sundi.ecgoods.web;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.sundi.ecgoods.entity.EcGoodsAttribute;
import com.sundi.ecgoods.service.IEcGoodsAttributeService;
import com.sundi.ecgoods.vo.ResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 商品参数表 前端控制器
 * </p>
 *
 * @author jgn
 * @since 2020-02-25
 */
@RestController
@RequestMapping("/ecGoodsAttribute")
public class EcGoodsAttributeController {

    @Autowired
    IEcGoodsAttributeService goodsAttributeService;

    @RequestMapping("list")
    public ResultEntity list(Integer id){
        Wrapper<EcGoodsAttribute> wrapper = new EntityWrapper<EcGoodsAttribute>();
        wrapper.eq("goods_id",id);
        List<EcGoodsAttribute> ecGoodsAttributes = goodsAttributeService.selectList(wrapper);
        return ResultEntity.ok(ecGoodsAttributes);
    }

}
